package com.power.leopard.constants;

import java.util.regex.Pattern;

import com.power.leopard.ConfigManagerLoader;

public class Constants {

	public static final Pattern CommaSplitPattern = Pattern.compile("\\s*[,]+\\s*");

	public static final String PROTOCOL_HTTP = "http";

	public static final String PROTOCOL_DEFAULT = "default";

	public static final String KEY_MONITOR_ENABLED = "pigeon.monitor.enabled";

	public static final int CALLTYPE_REPLY = 1;
	public static final int CALLTYPE_NOREPLY = 2;

	// 消息类型----》心跳消息
	public static final int MESSAGE_TYPE_HEART = 1;
	public static final int MESSAGE_TYPE_SERVICE = 2;
	public static final int MESSAGE_TYPE_EXCEPTION = 3;
	public static final int MESSAGE_TYPE_SERVICE_EXCEPTION = 4;
	public static final int MESSAGE_TYPE_HEALTHCHECK = 5;

	public static final boolean RESET_TIMEOUT = ConfigManagerLoader.getConfigManager().getBooleanValue(
			"pigeon.timeout.reset", true);
	public static final boolean REPLY_MANUAL = ConfigManagerLoader.getConfigManager().getBooleanValue(
			"pigeon.provider.reply.manual", false);

	public static final boolean RETRY_NETWORK_EXCEPTION = ConfigManagerLoader.getConfigManager().getBooleanValue(
			"pigeon.invoker.retry.networkexception", true);

	
	public static final String REQUEST_TIMEOUT = "requestTimeout";
	public static final String TRANSFER_NULL = "NULL";

}
